<html>
<head><meta charset="utf-8"><title>Where to put tests for macros? · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Where.20to.20put.20tests.20for.20macros.3F.html">Where to put tests for macros?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="232861560"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Where%20to%20put%20tests%20for%20macros%3F/near/232861560" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jade <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Where.20to.20put.20tests.20for.20macros.3F.html#232861560">(Apr 02 2021 at 05:14)</a>:</h4>
<p>I want to debug/write a test for a <code>macro_rules!</code> macro originally sourced from rustc that breaks RA's macro analysis. Where can I put such a test? It seems to parse ok, but causes a <code>macro-error</code>, so the harnessing on the <code>syntax</code> crate wouldn't work for it.</p>



<a name="232864638"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Where%20to%20put%20tests%20for%20macros%3F/near/232864638" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dawer <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Where.20to.20put.20tests.20for.20macros.3F.html#232864638">(Apr 02 2021 at 06:09)</a>:</h4>
<p>You mean MBE expansion test? They are in <code>crates/mbe/src/tests/expand.rs</code></p>



<a name="232872215"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Where%20to%20put%20tests%20for%20macros%3F/near/232872215" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jade <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Where.20to.20put.20tests.20for.20macros.3F.html#232872215">(Apr 02 2021 at 08:00)</a>:</h4>
<p>hm. upon some manual "bisection" I realized I simply rediscovered <a href="https://github.com/rust-analyzer/rust-analyzer/issues/8092">https://github.com/rust-analyzer/rust-analyzer/issues/8092</a> <span aria-label="laughing" class="emoji emoji-1f606" role="img" title="laughing">:laughing:</span> oops. ty for the help!</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>